import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-core/core/serviceinfo/service_info/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-core/core/serviceinfo/service_info/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/rb-core/core/serviceinfo/service_info/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/rb-core/core/serviceinfo/service_info/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/rb-core/core/serviceinfo/service_info/submit',
    method: 'post',
    data: row
  })
}

/* 服务商 导出 */
export const getExport = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-core/core/serviceinfo/service_info/export',
    method: 'get',
    params: {
      ...params,
    }
  })
}

/* 服务商 导出模板 */
export const getExportTemplate = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-core/core/serviceinfo/service_info/export-template',
    method: 'get',
    params: {
      ...params,
    }
  })
}